package ru.spb.osll.myfit.fixtures;

import ru.spb.osll.myfit.fixtures.base.OneLineFixture;
import ru.spb.osll.myfit.ssh.SSHClientManager;
import ru.spb.osll.myfit.ssh.SSHFixturesContainer;

public class DisconnectSshFixture extends OneLineFixture {
  
  public boolean disconnectSsh() throws Exception{
    SSHClientManager clientManager = SSHFixturesContainer.getSSHClientManager();
    if(clientManager == null){
      throw new Exception("Can't disconnect ssh. Connection is not established.");
    }
    clientManager.close();
    return true;
  }
  
  public static String[] getTestTableTemplates() {
    return new String[] {"|disconnect ssh|"};
  }
}
